<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div>
      <h1>text-align</h1>
      <div style="text-align: center">2312312</div>
    </div>

    <div>
      <h1>margin:auto</h1>
      <div>
        <p style="width: 100px; margin: 10px auto">1212s</p>
      </div>
    </div>

    <div>
      <h1>margin:auto</h1>
      <div style="position: relative">
        <p style="position: absolute; left: 50%; transform: translateX(-50%)">
          1212s
        </p>
      </div>
    </div>

    <div>
      <h1>flex居中</h1>
      <div style="display: flex">
        <p style="justify-content: center">1212s</p>
      </div>
    </div>
  </body>
</html>
